package com.ktjy.controller;

import com.ktjy.pojo.SysDictData;
import com.ktjy.service.SysDictDataService;
import com.ktjy.utils.AjaxResult;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/sys/dict/data")
@Tag(name="字典数据模块")
@Slf4j
public class SysDictDataController {

    @Autowired
    private SysDictDataService sysDictDataService;

    @RequestMapping("/list/dictType")
    public AjaxResult list(@RequestParam("dictType") String dictType) {
        SysDictData sysDictData = new SysDictData();
        sysDictData.setDictType(dictType);
        List<SysDictData> result = sysDictDataService.findList(sysDictData);
        return AjaxResult.success(result);
    }
}
